import React, {Component} from 'react';
import {Link, Switch, Route} from 'react-router-dom'

import SmallPage1 from './SmallPage1'
import SmallPage2 from './SmallPage2'
import SmallPage3 from './SmallPage3'
export default class BigPage extends React.Component {
  constructor() {
    super();
  }
  render() {
    return (<div>
      <p>我是bigPage</p>
      <Link to="/bigpage/page1">small page1</Link><br />
      <Link to="/bigpage/page2">small page2</Link><br />
      <Link to="/bigpage/page3">small page3</Link><br />
      <hr/>
      <Switch>
        {/* 定义嵌套路由时，要写完整的路由信息 */}
        <Route path="/bigpage/page1" component={SmallPage1} />
        <Route path="/bigpage/page2" component={SmallPage2} />
        <Route path="/bigpage/page3" component={SmallPage3} />
      </Switch>
    </div>)
  }
}